package entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.QueryHint;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author uel
 */
@Entity
@Table(name = "eve_area_tematica")
@NamedQueries({
@NamedQuery(name = "EveAreaTematica.findAll", 
            query = "SELECT e FROM EveAreaTematica e",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findByCodAreaTematica", 
            query = "SELECT e FROM EveAreaTematica e WHERE e.codAreaTematica = :codAreaTematica",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findByDesAreaTematica", 
            query = "SELECT e FROM EveAreaTematica e WHERE e.desAreaTematica = :desAreaTematica",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findByResIncl", 
            query = "SELECT e FROM EveAreaTematica e WHERE e.resIncl = :resIncl",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findByDatIncl", 
            query = "SELECT e FROM EveAreaTematica e WHERE e.datIncl = :datIncl",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findByResAlter", 
            query = "SELECT e FROM EveAreaTematica e WHERE e.resAlter = :resAlter",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findByDatAlter", 
            query = "SELECT e FROM EveAreaTematica e WHERE e.datAlter = :datAlter",
            hints=@QueryHint(name="toplink.refresh", value="true")),
@NamedQuery(name = "EveAreaTematica.findMax", 
            query = "SELECT max(e.codAreaTematica) FROM EveAreaTematica e",
            hints=@QueryHint(name="toplink.refresh", value="true"))})
            
public class EveAreaTematica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cod_area_tematica")
    private Integer codAreaTematica;
    @Column(name = "des_area_tematica")
    private String desAreaTematica;
    @Basic(optional = false)
    @Column(name = "res_incl")
    private String resIncl;
    @Basic(optional = false)
    @Column(name = "dat_incl")
    @Temporal(TemporalType.DATE)
    private Date datIncl;
    @Column(name = "res_alter")
    private String resAlter;
    @Column(name = "dat_alter")
    @Temporal(TemporalType.DATE)
    private Date datAlter;
    @OneToMany(mappedBy = "codAreaTematica")
    private Collection<EveCurso> eveCursoCollection;

    public EveAreaTematica() {
    }

    public EveAreaTematica(Integer codAreaTematica) {
        this.codAreaTematica = codAreaTematica;
    }

    public EveAreaTematica(Integer codAreaTematica, String resIncl, Date datIncl) {
        this.codAreaTematica = codAreaTematica;
        this.resIncl = resIncl;
        this.datIncl = datIncl;
    }

    public Integer getCodAreaTematica() {
        return codAreaTematica;
    }

    public void setCodAreaTematica(Integer codAreaTematica) {
        this.codAreaTematica = codAreaTematica;
    }

    public String getDesAreaTematica() {
        return desAreaTematica;
    }

    public void setDesAreaTematica(String desAreaTematica) {
        this.desAreaTematica = desAreaTematica;
    }

    public String getResIncl() {
        return resIncl;
    }

    public void setResIncl(String resIncl) {
        this.resIncl = resIncl;
    }

    public Date getDatIncl() {
        return datIncl;
    }

    public void setDatIncl(Date datIncl) {
        this.datIncl = datIncl;
    }

    public String getResAlter() {
        return resAlter;
    }

    public void setResAlter(String resAlter) {
        this.resAlter = resAlter;
    }

    public Date getDatAlter() {
        return datAlter;
    }

    public void setDatAlter(Date datAlter) {
        this.datAlter = datAlter;
    }

    public Collection<EveCurso> getEveCursoCollection() {
        return eveCursoCollection;
    }

    public void setEveCursoCollection(Collection<EveCurso> eveCursoCollection) {
        this.eveCursoCollection = eveCursoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codAreaTematica != null ? codAreaTematica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EveAreaTematica)) {
            return false;
        }
        EveAreaTematica other = (EveAreaTematica) object;
        if ((this.codAreaTematica == null && other.codAreaTematica != null) || (this.codAreaTematica != null && !this.codAreaTematica.equals(other.codAreaTematica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.EveAreaTematica[codAreaTematica=" + codAreaTematica + "]";
    }

}
